import request from '@/utils/request'

// 获取房源列表
export function houseList(data) {
    return request({
        url: '/front/house/member/houseList',
        method: 'get'
    })
}

// 获取用户入住房屋信息(分页)
export function userHouseList(params) {
    return request({
        url: '/front/house/member/list',
        method: 'get',
        params: params
    })
}

// 统计未缴订单数接口
export function unpaidOrderCount(orderId) {
    return request({
        url: '/front/flat/bill/house/countOutstanding/' + orderId,
        method: 'get'
    })
}

// 获取租客成员列表
export function memberList(orderId) {
    return request({
        url: '/front/house/member/memberInfo/' + orderId,
        method: 'get'
    })
}

// 获取租客成员详情
export function memberDetail(memberId) {
    return request({
        url: '/front/house/member/' + memberId,
        method: 'get'
    })
}

// 新增租客成员
export function addMember(data) {
    return request({
        url: '/front/house/member',
        method: 'post',
        data
    })
}

// 编辑租客成员
export function updateMember(data) {
    return request({
        url: '/front/house/member',
        method: 'put',
        data
    })
}

// 认证租客成员
export function authentication(data) {
    return request({
        url: '/front/house/member/authentication',
        method: 'put',
        data
    })
}

// 删除租客成员
export function deleteMember(memberId) {
    return request({
        url: '/front/house/member/' + memberId,
        method: 'delete'
    })
}

// 入住账单列表
export function billList(query) {
    const orderId = query.orderId
    return request({
        url: '/front/flat/bill/house/list',
        method: 'get',
        params: query
    })
}

// 入住账单详情
export function billDetail(billId) {
    return request({
        url: '/front/flat/bill/house/' + billId,
        method: 'get'
    })
}

// 入住账单支付(调起支付)
export function billPay(billId, payType) {
    return request({
        url: '/front/flat/bill/house/pay/' + billId+'/'+payType,
        method: 'get'
    })
}